package com.bamboo.custom.adapter;

import android.content.Context;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bamboo.custom.R;
import com.bamboo.custom.bean.CommonBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.QuickViewHolder;

import java.util.List;

/**
 * 项目名称：CustomViewExercise
 *
 * @Author bamboolife
 * 邮箱：core_it@163.com
 * 创建时间：2023/5/10 13:58
 * 描述：
 */
public class CommonAdapter extends BaseQuickAdapter<CommonBean, QuickViewHolder> {
    public CommonAdapter(@NonNull List<? extends CommonBean> items) {
        super(items);
    }

    @Override
    protected void onBindViewHolder(@NonNull QuickViewHolder quickViewHolder, int i, @Nullable CommonBean commonBean) {
        quickViewHolder.setText(R.id.tv_title,commonBean.getTitle());
    }

    @NonNull
    @Override
    protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
        return new QuickViewHolder(R.layout.bamboo_item_layout,viewGroup);
    }
}
